package com.dg.cuckoo.admin.action.integratedQuery.query;

import com.dg.cuckoo.admin.dto.projectDeclare.oneProDeclare.BuildDeclareDto;
import com.dg.cuckoo.admin.service.StatisticsService;
import com.dg.cuckoo.core.BaseController;
import com.dg.cuckoo.core.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 综合查询-建设项目申报统计查询-建设项目申报统计
 */
@RestController
@RequestMapping("/integratedQuery/query/statistics")
public class Statistics extends BaseController {

    @Autowired
    private StatisticsService statisticsService;

    /**
     * 查询
     * @param year 年
     * @param unit 建设单位
     * @return
     */
    @PostMapping("buildQuery")
    public JsonResult<List<BuildDeclareDto>> buildQuery(String year,String unit){
        List<BuildDeclareDto> data = statisticsService.buildQuery(year, unit);
        return new JsonResult<>(OK,data);
    }

}
